Skip to main content

Builder

The Prototype design pattern specifies the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.

Usage     Usage     Medium

UML class diagram

A visualization of the classes and objects participating in this pattern.

diagram

Sample code

This structural code demonstrates the Prototype pattern in which new objects are created by copying pre-existing objects (prototypes) of the same class.


Output


See also